home *** CD-ROM | disk | FTP | other *** search
- Path: netnews.whoi.edu!inn
- From: Mark Hill <mhill>
- Newsgroups: comp.lang.c
- Subject: Pointer swapping
- Date: 19 Mar 1996 15:24:13 GMT
- Organization: Woods Hole Oceanographic Institution
- Message-ID: <4imjit$oil@pearl.whoi.edu>
- NNTP-Posting-Host: gause.whoi.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.3_U1 sun4m)
- X-URL: news:comp.lang.c
-
- I have two int huge arrays with a pointer to each which I use to access and
- assign values. After assigning values to one of the arrays I want to swap
- pointers between the two arrays.
-
- int huge A;
- int huge B;
- int huge *prtA;
- int huge *prtB;
-
- main()
- {
- int ct = 0;
- do
- {
- int huge prtA = A;
- int huge ptrB = B;
- .
- .
- .
- .
- if (ct % 2 ==0 )
- {
- ptrA = B;
- ptrB = A;
- }
- else
- {
- ptrA = A;
- ptrB = B;
- }
- }while
-
- Information seems to be loss when I do this . Shouldn't this work?
-
-